<template>
  <div class="supplier-info-wrap">
    <el-form
      :class="{'mobile-el-form mobile-fly-detail': showMobilePage}"
      :label-position="showMobilePage?'left':'right'"
      label-width="110px"
      class="supplier-form height55">
      <el-row :gutter="20" :class="{'dividing': !showMobilePage}">
        <el-col :span="8">
          <el-form-item label="创建人:" style="margin-bottom: 0px;">
            <CheckUserInfo v-if="baseInfo.creator" :label="baseInfo.creator" :user-id="baseInfo.creatorId" />
            <div v-else>--</div>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="所属部门:" style="margin-bottom: 0px;">
            <ToolTip :content="baseInfo.departmentName"/>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="创建时间:" style="margin-bottom: 0px;">
            <ToolTip :content="format(baseInfo.createDate,'YYYY/MM/DD HH:mm')"/>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="询价标题:" style="margin-bottom: 0px;">
            <ToolTip :content="baseInfo.title"/>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="询价编号:" style="margin-bottom: 0px;">
            <ToolTip :content="baseInfo.sn"/>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="价格有效期:" style="margin-bottom: 0px;">
            <ToolTip v-if="baseInfo.priceStartTime || baseInfo.priceEndTime" :content="`${format(baseInfo.priceStartTime,'YYYY/MM/DD')}-${format(baseInfo.priceEndTime,'YYYY/MM/DD')}`"/>
            <div v-else>--</div>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="询价说明:" style="margin-bottom: 0px;">
            <ToolTip :content="baseInfo.description"/>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="服务号通知：">
            <div v-if="typeof baseInfo.enableNotification === 'number'" style="font-size: 14px">{{ baseInfo.enableNotification ? '开启' : '关闭' }}</div>
            <div v-else>--</div>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
  </div>
</template>
<script>
import { format } from '@/filters/date';
import { mapState } from 'vuex';

export default {
  props: {
    baseInfo: {// 详情信息
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      format
    };
  },
  computed: {
    ...mapState({
      'showMobilePage': state => state.app.showMobilePage
    })
  },
  methods: {}
};
</script>
<style lang="scss" scoped>
  .supplier-info-wrap{
    .mobile-fly-detail {
      padding-left: 10px;
    }
    .supplier-form {
      & ::v-deep {
        .el-form-item {
            .el-form-item__label {
              font-size: 14px;
              font-family: PingFang SC;
              font-weight: 400;
              color: #999999 !important;
              opacity: 1;
              line-height: 30px;
            }
          }
          .el-form-item__content {
            font-size: 14px;
            font-family: PingFang SC;
            line-height: 30px;
            font-weight: 400;
            color: #333333;
            opacity: 1;
          }
      }
    }
    .link{
      color: #406EFF;
      cursor: pointer;
    }
    .dividing{
      &::v-deep {
        .el-col {
          .el-form-item__content {
            border-right: 1px solid #EBEEFD;
          }
          &:nth-child(3n) {
            .el-form-item__content {
              border-right: none;
            }
          }
          &:last-child {
            .el-form-item__content {
              border-right: none;
            }
          }
        }
      }
    }
  }
</style>
